package com.qm.console.pubdef.constant.bx;

import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * //                       _oo0oo_
 * //                      o8888888o
 * //                      88" . "88
 * //                      (| -_- |)
 * //                      0\  =  /0
 * //                    ___/`---'\___
 * //                  .' \\|     |// '.
 * //                 / \\|||  :  |||// \
 * //                / _||||| -:- |||||- \
 * //               |   | \\\  -  /// |   |
 * //               | \_|  ''\---/''  |_/ |
 * //               \  .-\__  '-'  ___/-. /
 * //             ___'. .'  /--.--\  `. .'___
 * //          ."" '<  `.___\_<|>_/___.' >' "".
 * //         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
 * //         \  \ `_.   \_ __\ /__ _/   .-` /  /
 * //     =====`-.____`.___ \_____/___.-`___.-'=====
 * //                       `=---='
 * //
 * //
 * //     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * //
 * //               佛祖保佑         永无BUG
 * <p>
 * com.qm.console.pubdef.constant.bx
 * Created on 2021/1/9.
 */
public class BxGroupers {

    public static final String APP_VERSION = "app_version";

    public static final String GENDER = "gender";

    public static final String APP_CHANNEL = "app_channel";

    public static final String APP_NAME = "app_name";

    public static final String TAGS = "tags";

    private static final Map<String, String> sGrouperNames = new HashMap<>();

    static {
        sGrouperNames.put(APP_NAME, "包名");
        sGrouperNames.put(APP_VERSION, "版本号");
        sGrouperNames.put(GENDER, "性别");
        sGrouperNames.put(TAGS, "标签");
        sGrouperNames.put(APP_CHANNEL, "渠道");
    }

    public static boolean isGrouper(String grouper) {
        return StringUtils.equals(grouper, APP_CHANNEL)
                || StringUtils.equals(grouper, GENDER)
                || StringUtils.equals(grouper, APP_VERSION)
                || StringUtils.equals(grouper, APP_NAME)
                || StringUtils.equals(grouper, TAGS);
    }

    public static String grouperNames(String grouper) {
        return sGrouperNames.getOrDefault(grouper, grouper);
    }


}
